﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using NHibernateSample.Domain.Entities;
using NHibernate;

namespace NHibernateSample.Data.Test
{
    [TestFixture]
    public class NHibernateSampleFixture
    {
        private ISession _session;
        private NHibernateHelper _helper;
        private NHibernateSample _sample;
        [TestFixtureSetUp]
        public void TestFixtureSetup()
        {
            _helper = new NHibernateHelper();
            _session = _helper.GetSession();
            _sample = new NHibernateSample(_session);
        }
        [Test]
        public void GetCustomerByIdTest()
        {
            //var tempCutomer = new Customer { FirstName="1",LastName="1"};
            //_sample.CreateCustomer(tempCutomer);
            Customer customer = _sample.GetCustomerById(1);
            int customerId = customer.Id;
            Assert.AreEqual(1,customerId);
        }
    }
}
